import instance from "./request";
// 获取左侧数据
export function getlist() {
  return instance.get("/shenpi");
}
// 搜索
export function searchlist(name: any, type: any, ren: any, time: any) {
  return instance.get("shenpi", {
    params: {
      name_like: name,
      type_like: type,
      ren_like: ren,
      time_like: time,
    },
  });
}
// 添加
export function addlist(obj:any){
  return instance.post("shenpi", obj);
}
// 编辑
export function editlist(obj: any) {
  return instance.patch(`shenpi/${obj.id}`, obj);
}
// 删除
export function dellist(id: number) {
  return instance.delete(`shenpi/${id}`);
}









export function getShoplist() {
  return instance.get("shoplist");
}

export function addShoplist(obj: any) {
  return instance.post("shoplist", obj);
}

export function delShoplist(id: number) {
  return instance.delete(`shoplist/${id}`);
}

export function emitShoplist(obj: any) {
  return instance.patch(`shoplist/${obj.id}`, obj);
}

export function searchShoplist(
  title: string,
  author: string,
  qi: string,
  money: string,
  time: string,
  state: boolean
) {
  return instance.get("shoplist", {
    params: {
      title_like: title,
      author_like: author,
      qi,
      money_like: money,
      time_like: time,
      state,
    },
  });
}
